To check if a condition is true within a time period you use the Interval Verifier functions (Interval Always, Interval Sometimes, Interval At Least Days, Interval Consecutive Days) and the Temporal Verifier functions (Temporal Always Days, Temporal Consecutive Days, Temporal Sometimes Days).
The Interval Verifier functions work on boolean attributes and verify whether the attribute is true always, sometimes or for a consecutive number of days within a time span.
The Temporal Verifier functions operate on boolean attributes and return a boolean attribute that varies over time. They verify if the boolean attribute is true always, sometimes or for a consecutive number of days within a specified number of preceding days.
Check if a condition is true at all times in the time period
Check if a condition is ever true in the time period
Check if a condition is true for at least the specified number of days in the time period
Check if a condition is true for all of a specified number of preceding days
Check if a condition is true for at least the specified number of consecutive preceding days
Check if a condition is ever true within a specified number of preceding days
The Interval Always function returns true if and only if the attribute is true at all times in the interval from the specified start date (inclusive) to the end date (exclusive). The syntax for this function is:
For example, the Interval Always function could be used to determine whether the client was in jail at all times between 10 July 2006 and 20 July 2006 (inclusive). In Word you would write this rule as:
the client was in jail at all times during the assessment period if
IntervalAlways(2006-07-10,2006-07-21,the client was in jail)
The function returns a value of true for 'the client was in jail at all times during the assessment period' for the following data where b1 is 'the client was in jail':
The Interval Sometimes function returns true if and only if the attribute is ever true in the interval from the specified start date (inclusive) to the end date (exclusive). The syntax for this function is:
For example, the Interval Sometimes function could be used to determine whether the client was in Australia at any time between 8 January 2007 and 22 January 2007 (inclusive). In Word you would write this rule as:
the client has been in Australia if
IntervalSometimes(2007-01-08,2007-01-23,the client was in Australia)
This function returns a value of true for 'the client has been in Australia' for the following data where b4 is 'the client was in Australia':
The Interval At Least Days function returns true if and only if the attribute is true for at least the specified number of days (not necessarily consecutive) in the interval from the specified start date (inclusive) to the end date (exclusive). The syntax for this function is:
For example, the Interval At Least Days function could be used to determine whether an employee has been at work for at least 5 days during the assessment period. The assessment period begins on 1/7/07 and ends on 7/7/07 (inclusive). In Word you would write this rule as:
the employee has been at work for at least 5 days during the assessment period if
IntervalAtLeastDays(2007-07-01,2007-07-08,5,the employee was working)
The function returns a value of true for 'the employee has been at work for at least 5 days during the assessment period' for the following data where b3 is 'the employee was working':
The Interval Consecutive Days function returns true if and only if the attribute is true for at least the specified number of consecutive days in the interval from the specified start date (inclusive) to the end date (exclusive). The syntax for this function is:
For example, the Interval Consecutive Days function could be used to determine whether an employee has been at work for at least 5 consecutive days during the assessment period. The assessment period begins on 1/7/07 and ends on 7/7/07 (inclusive). In Word you would write this rule as:
the employee has been at work for at least 5 consecutive days during the assessment period if
IntervalConsecutiveDays(2007-07-01,2007-07-08,5,the employee was working)
This function returns a value of false for 'the employee has been at work for at least 5 consecutive days during the assessment period' for the following data where b3 is 'the employee was working':
The Temporal Always Days function returns a boolean attribute that varies over time and is true if and only if the given boolean attribute is true for all of a specified number of preceding days, not including the current day. The syntax for this function is:
For example, the Temporal Always Days function could be used to determine whether an employee has been at work for the last 4 days. In Word you would write this rule as:
the employee has been at work for the last 4 days if
TemporalAlwaysDays(4,the employee was working)
If this rule is applied to the sample data below where b1 is 'the employee was working', b2 'the employee has been at work for the last 4 days' would take the following temporal result: {false, true from Day 6, false from Day 9}.
NOTE: If <number> is defined as zero, the result will always be true regardless of the value of the <boolean> parameter.
TIP: To see an example of a complete rulebase using this function, open and run the Aged Care Approval rulebase project provided in the Examples folder in the Oracle Policy Modeling installation folder.
The Temporal Consecutive Days function returns a boolean attribute that varies over time and is true if and only if the given boolean attribute is true for at least a specified number of consecutive days at any time within the preceding specified number of days, not including the current day. The syntax for this function is:
For example, the Temporal Consecutive Days function could be used to determine whether a customer's bank account balance has exceeded $50 for at least 2 consecutive days at any time in the last 5 days. In Word you would write this rule as:
the customer's bank balance has exceeded $50 for at least 2 consecutive days in the last 5 days if
TemporalConsecutiveDays(2,5,the customer's bank balance exceeds $50)
If this rule is applied to the sample data below, b3 'the customer's bank balance has exceeded $50 for at least 2 consecutive days in the last 5 days' would take the following temporal result: {false, true from Day 4, false from Day 9}. b5 is 'the customer's bank balance exceeds $50'.
NOTES:
The Temporal Sometimes Days function returns a boolean attribute that varies over time and is true if and only if the given boolean attribute is ever true within a specified number of preceding days, not including the current day. The syntax for this function is:
For example, the Temporal Sometimes Days function could be used to determine whether a customer's bank account balance has exceeded $100 at any time in the last 4 days. In Word you would write this rule as:
the customer's bank balance has exceeded $100 in the last 4 days if
TemporalSometimesDays(4,the customer's bank balance exceeds $100)
If this rule is applied to the sample data below, 'the customer's bank balance has exceeded $100 in the last 4 days' (b4) would take the following temporal result: {false, true from Day 3, false from Day 9}. b6 is 'the customer's bank balance exceeds $100'.
NOTE: If <number> is defined as a zero, the result will always be false regardless of the value of the <boolean> parameter.